﻿@using MvcPaging
@using QuocHoi_TV_Frontend.Models;
@model IPagedList<QuocHoi_TV_Frontend.Models.CommentNew>
<div class="more_comment">
<ul>
    @foreach (var item in Model)
    {
        <li class="infocom">
            <h2>@item.UserName</h2>
            <span class="hour_cm">@Html.Raw(UtilDate.GetTimeSpan(DateTime.Parse(item.DateCreate.ToString())))</span>
            <p class="email">@item.Email</p>
            <p>@item.Contents</p>
            <div class="answer_cm">
                <div class="sendcomment">
                    <input id="comment_post_button" class="button btn_send_comment" type="button" value="Trả lời">
                </div>
            </div>
        </li>   
    }
</ul>
</div> 
<div class="next_page_on">
	@Html.Raw(Ajax.Pager(
    new Options
    {
        PageSize = Model.PageSize,
        TotalItemCount = Model.TotalItemCount,
        CurrentPage = Model.PageNumber,
        ItemTexts = new ItemTexts() { Next = "", Previous = "", Page = "", First = "", Last = "" },
        ItemIcon = new ItemIcon() { First = "icon-backward", Previous = "icon-chevron-left", Next = "icon-chevron-right", Last = "icon-forward" },
               
        Size = Size.normal,
        Alignment = Alignment.left,
        IsShowControls = true,
        IsShowFirstLast = true
       
    },
    new AjaxOptions
    {
        UpdateTargetId = "grid-list",
        OnBegin = "beginPaging",
        OnSuccess = "successPaging",
        OnFailure = "failurePaging"
    }, new { controller = "Broadcast", action = "VideoDetail"}))
</div>
<script type="text/javascript">

    function beginPaging(args) {
        // Animate
        //$('#grid-list').fadeOut('normal');
    }

    function successPaging() {
        // Animate
        //$('#grid-list').fadeIn('normal');
        //$('a').tooltip();
    }

    function failurePaging() {
        alert("Could not retrieve list.");
    }

    function searchFailed() {
        $("#grid-list").html("Sorry, there was a problem with the search.");
    }

</script>